<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link rel="stylesheet" type="text/css" href="../resources/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../resources/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="../resources/css/grumble.css">

    <script type="text/javascript" src="../../static/js/user/jq181.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript" src="../resources/scripts/jquery.grumble.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/zhBase.js"></script>
    <script type="text/javascript" src="../resources/scripts/zhForm.js"></script>
    <script type="text/javascript" src="../../static/js/ajaxfileupload.js"></script>

    <script src="../../sys/vote/portrait.js"></script>
    <script>
        $(function () {

            //初始化时间插件
            $('.form_datetime').datetimepicker({
                format: 'yyyy-mm-dd',
                language: 'zh-CN',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                minView: 2,
                forceParse: 0
            }).click(function () {
                $(this).val("");
            });
        });
    </script>

    <style>
        .portrait {
            float: left;
        }
    </style>
</head>
<BODY class="mian_bg">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
    <TR height=28>
        <TD class="addr_td">&nbsp;&nbsp;<img src="/sys/resources/images/addr_icon.png">&nbsp;当前位置: 投票管理>增加被投票人</TD>
    </TR>
    <TR>
        <TD bgColor=#7ca600 height=1></TD>
    </TR>
    <TR>
        <TD bgColor=#8ebe00 height=1></TD>
    </TR>
</TABLE>

<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
    <h3 class="panel-title">增加被投票人</h3>
</div>
<div class="panel-body">
<form action="/sys/voption/addVoption.do" id="formId" class="form-horizontal" role="form">
    <div class="row" style="margin-bottom: 20px">
        <div class="col-xs-4">
        </div>
        <div class="col-xs-4">
            <c:choose>
                <c:when test="${not empty headurl}">
                    <img id="portrait" src="${headurl}" width="120px" height="120px">
                </c:when>
                <c:otherwise>
                    <img id="portrait" src="/static/images/default.gif" width="120px" height="120px">
                </c:otherwise>
            </c:choose>
        </div>
        <div class="col-xs-2">
        </div>
    </div>
    <div class="row">
        <div class="col-xs-8">
            <div class="form-group">

                <input name="voteid" type="hidden" value="${voteid}"/>

                <label class="col-sm-3 control-label">选择头像</label>

                <div class="col-sm-7">
                    <input name="url" type="hidden" id="url"/>
                    <input name="imgFile" type="file" style="display: none;" class="form-control" id="imgFile"/>
                    <input name="imgurl" type="text" notNull="true" class="form-control" id="imgurl"
                           placeholder="原始图片名称" readonly/>
                </div>
                <div class="col-sm-2">
                    <button id="fileBtn" type="button" class="btn btn-info btn-sm">上传图片</button>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-8">
            <div class="form-group">
                <label for="title" class="col-sm-3 control-label">名称</label>

                <div class="col-sm-9">
                    <input name="title" type="text" notNull="true" class="form-control" id="title"
                           placeholder="名称">
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-8">
            <div class="form-group">
                <label for="title" class="col-sm-3 control-label">简要描述</label>

                <div class="col-sm-9">
                    <textarea name="content" type="text" notNull="true" class="form-control" id="content"></textarea>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-2">
        </div>
        <div class="col-xs-4">
            <input type="submit" id="btnid" class="btn btn-success btn-block" value="添加">
        </div>
        <div class="col-xs-2">
        </div>
    </div>
</form>
<hr/>
<div id="piczone">

    <c:forEach var="item" items="${listUser}">
        <div class="row,portrait" id="${item.id}">
            <div class="col-xs-3">
                <div>
                    <c:choose>
                        <c:when test="${not empty item.url}">
                            <img src="${item.url}" width="120px" height="120px">
                        </c:when>
                        <c:otherwise>
                            <img src="../../static/images/default.gif" width="120px" height="120px">
                        </c:otherwise>
                    </c:choose>
                </div>
                <br/>
                <p>名称:<span style="color: red">${item.title}</span></p>
                <p>描述:
                    <span style="color: red">
                       ${item.content}
                    </span>
                </p>
                <p>
                    <button id="${item.id}" type="button" class="btn btn-info btn-sm" onclick="del(${item.id})">删除</button>
                </p>
            </div>
        </div>
    </c:forEach>
</div>
</div>
</div>
</div>
<c:if test="${not empty msg}">
    <script type="text/javascript">
        alert("${msg}");
    </script>
</c:if>
</body>
</html>
